﻿using System.ComponentModel.Composition;
using MEF_Test.Contracts;
using Microsoft.Practices.Prism.Events;

namespace MEF_Test.VideoRenderer.PlaybackControl
{
    [Export(typeof(IPlaybackControlsViewModelFactory))]
    public class PlaybackControlsViewModelFactory : IPlaybackControlsViewModelFactory
    {
        private readonly IEventAggregator _eventAggregator;
        [ImportingConstructor]
        public PlaybackControlsViewModelFactory(IEventAggregator eventAggregator)
        {
            _eventAggregator = eventAggregator;
        }

        public IPlaybackControlsViewModel Create()
        {
            return new PlaybackControlsViewModel(_eventAggregator);
        }
    }
}